<?php

namespace app\business\controller;

use think\Controller;
use Util\SysDb;

class Advert extends Controller
{
    public function advert()
    {
        
        $type = trim(input('param.type'));
        $tenantId = trim(input('param.tenantId'));
        $this->db = new SysDb();
        $admin = $this->db->table('tenant_advert')->where(['type' => $type,'tenant_id' => $tenantId])->lists();
        if (!$admin) {
            exit(json_encode(['code' => 1, 'message' => 'error',"result"=>"无图片" ]));
        }else{
            exit(json_encode(['message' =>'succ','result'=>$admin]));
        }
    }
}
